﻿using Computerlock.Helper;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;

namespace Computerlock
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //解除锁定
            if (textBox1.Text.Trim() == "123456")
            {

                hook.Hook_Clear();
                FullScreenHelper.SetFormFullScreen(false);
                this.Close();
            }
            else
            {
                MessageBox.Show("密码错误！", "提示");
            }
        }

        private void Form1_KeyDown(object sender, KeyEventArgs e)
        {
            //if ((e.KeyCode == Keys.F4) && (e.Alt == true))
            //{
            //    e.Handled = true;
            //}
        }
        KeysHook hook;
        private void Form1_Load(object sender, EventArgs e)
        {
            hook = new KeysHook();
            hook.Hook_Start();
            FullScreenHelper.SetFormFullScreen(true);
            this.WindowState = FormWindowState.Maximized;
            this.Activate();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            this.Activate();
        }
    }


}
